package com.aqiang.day0528_shop.main.adapter

import android.view.View
import android.widget.CheckBox
import android.widget.TextView
import com.aqiang.day0528_shop.R
import com.aqiang.day0528_shop.main.entity.UserAdress
import com.chad.library.adapter.base.BaseItemDraggableAdapter
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder

class AddressAdapter(lay:Int,data:MutableList<UserAdress>) : BaseItemDraggableAdapter<UserAdress,BaseViewHolder>(lay,data) {
    override fun convert(helper: BaseViewHolder?, item: UserAdress?) {
        if(helper?.layoutPosition == 0){
            helper.getView<CheckBox>(R.id.cb_item_re).visibility = View.VISIBLE
            helper.getView<TextView>(R.id.tv_item_re).visibility = View.VISIBLE
            helper.getView<TextView>(R.id.tv_item_re_j).visibility = View.VISIBLE
        }
        helper?.setText(R.id.tv_item_re_name,item?.name)
        helper?.setText(R.id.tv_item_re_tel,item?.tel)
        helper?.setText(R.id.tv_item_re_address,"${item?.area}${item?.address}")
    }
}